//
//  BaseTableViewCell.m
//  GOGOTravel
//
//  Created by dllo on 16/3/7.
//  Copyright © 2016年 果果. All rights reserved.
//

#import "BaseTableViewCell.h"

#import "Daily.h"
@interface BaseTableViewCell ()



@end

@implementation BaseTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
       
        
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"yeJianMoShi"] isEqualToString:@"isDay"]) {
            self.backgroundColor = DAYCOLOR;
            self.textLabel.textColor = [UIColor blackColor];
        }else{
            self.backgroundColor = [UIColor lightGrayColor];
            self.textLabel.textColor = [UIColor whiteColor];

        }
        
        
    }
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"yeJianMoShi" object:nil];
    
  
    
    return self;
}






- (void)changeColor:(NSNotification *)notification{
    
    if ([[[NSUserDefaults standardUserDefaults]objectForKey:@"yeJianMoShi"]isEqualToString:@"isNight"]) {
        self.backgroundColor = [UIColor lightGrayColor];
        self.textLabel.textColor = [UIColor whiteColor];

    }else{
        
        self.backgroundColor = DAYCOLOR;
        self.textLabel.textColor = [UIColor blackColor];

    }

    
}




- (void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"changeColor" object:nil];
    [super dealloc];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
